<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .container {
        margin: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-evenly;
        align-items: center;
        width: 30vw;
        height: 30vw;
        background-color: #bdc3c7;
      }
      .container div {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 9vw;
        height: 9vw;
        background-color: #7f8c8d;
        border: 2px solid #34495e;
        box-sizing: border-box;
      }
      .container #btn {
        cursor: pointer;
      }
      .container .active {
        background-color: #16a085;
      }
    </style>
    <script src="./nineRichLottery.js"></script>
  </head>
  <body>
    <div class="container">
      <div class="box">奖品1</div>
      <div class="box">奖品2</div>
      <div class="box">奖品3</div>
      <div class="box">奖品4</div>
      <div id="btn">按钮</div>
      <div class="box">奖品5</div>
      <div class="box">奖品6</div>
      <div class="box">奖品7</div>
      <div class="box">奖品8</div>
    </div>
  </body>
  <script>
    let l = new nineRichLottery(document.querySelectorAll(".container div"), 0);
    document.querySelector("#btn").addEventListener("click", function () {
      l.init();
    });
  </script>
</html>
